package com.wiwf.model.manage.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author kehui
 */
@Controller
public class LayuiController {

    @RequestMapping({"layui","layui/","layui/index"})
    public String def() {
        return "redirect:/layui/index.html";
    }

    @RequestMapping({"layui/index.html"})
    public String index() {
        return "/api/page/index";
    }

    @RequestMapping({"layui/{page1}"})
    public String page1(@PathVariable("page1")String page1) {
        return "/api/page/"+page1;
    }

    @RequestMapping({"layui/{page1}/{page2}"})
    public String page2(@PathVariable("page1")String page1,@PathVariable("page2")String page2) {
        return "/api/page/"+page1+"/"+page2;
    }

    @RequestMapping({"layui/{page1}/{page2}/{page3}"})
    public String page3(@PathVariable("page1") String page1,@PathVariable("page2") String page2,@PathVariable("page3") String page3) {
        return "/api/page/"+page1+"/"+page2+"/"+page3;
    }

}
